package com.shermanzhou.codegen.core.util;

/**
 * @author zhouchaoqun
 * @date 2018/12/12 下午3:21
 */
public class ProtobufTypeUtil {

    public static String protoTypeFor(String simpleClassName) {
        if (simpleClassName == null || simpleClassName.length() == 0) {
            return null;
        }
        String protoType = null;
        switch (simpleClassName) {
            case "Integer":
                protoType = "int32";
                break;
            case "Long":
            case "Date":
                protoType = "int64";
                break;
            case "Float":
                protoType = "float";
                break;
            case "Double":
                protoType = "double";
                break;
            case "String":
                protoType = "string";
                break;
            default:
                protoType = "string";
        }
        return protoType;
    }
}
